public class Test {

    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {

//        会报错，因为抽象类不可以进行初始化
//        Shape shape1 = new Shape()

//        向下传参不会报错
        Shape shape = new Rect();
        shape.draw();
        shape.draw();

        Rect rect = new Rect();
        rect.draw();
        rect.draw();




//        匿名对象

        new Rect().draw();
        new Rect().draw();
        drawMap(new Rect());
        drawMap(new Cycle());

    }
}
